<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>FEUP-Defender: Sprite</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Gerado por Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Página&nbsp;principal</span></a></li>
      <li><a href="modules.html"><span>Módulos</span></a></li>
      <li><a href="annotated.html"><span>Estruturas&nbsp;de&nbsp;dados</span></a></li>
      <li><a href="files.html"><span>Ficheiros</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Sprite</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Estruturas de Dados</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sprite.html">Sprite</a></td></tr>
<tr><td colspan="2"><h2>Macros</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#gac2cd96d53dd3ba6407db6766c3d92b26">MAX_SPEED</a>&nbsp;&nbsp;&nbsp;5</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#gaeb36ab00594b7e7e003a891d8e823f81">RIGHT_HIT</a>&nbsp;&nbsp;&nbsp;2</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga7a047d192cdd3831464a17e3a3e5de6c">LEFT_HIT</a>&nbsp;&nbsp;&nbsp;3</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga56c64c13c42271b70bcb51986ee8da20">MOUSE_HIT</a>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td colspan="2"><h2>Funções</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga87bd140b1b1b28386f37ebac5c9b9d2e">read_xpm</a> (char *map[], int *width, int *height)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#gac732cca247655c1bac63318eb29ffe7f">create_sprite</a> (char *pic[])</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaea125ed51778887ae732641df4842663"></a><!-- doxytag: member="sprite::create_unbuffered_sprite" ref="gaea125ed51778887ae732641df4842663" args="(char *pic[])" -->
<a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>create_unbuffered_sprite</b> (char *pic[])</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa9ab6a26ab5bfd7ffc480128d6a4d307"></a><!-- doxytag: member="sprite::capture_screen" ref="gaa9ab6a26ab5bfd7ffc480128d6a4d307" args="(int x_ini, int y_ini, int width, int height, char *base)" -->
<a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><b>capture_screen</b> (int x_ini, int y_ini, int width, int height, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga5c23ddc01d5d729ab434ae2dbb497d9b">draw_sprite</a> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga238099ba434fd07b23337a83df742773"></a><!-- doxytag: member="sprite::update_sprite" ref="ga238099ba434fd07b23337a83df742773" args="(Sprite *sprt, char *base)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>update_sprite</b> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#gafd72bd42b3d68e35201c12ce287cd3e7">draw_sprite_rotated</a> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base, int angle)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0c8170d1127ecc74d58f87b112b1b461"></a><!-- doxytag: member="sprite::draw_sprite_scaled" ref="ga0c8170d1127ecc74d58f87b112b1b461" args="(Sprite *sprt, char *base, int width, int height)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>draw_sprite_scaled</b> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base, int width, int height)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga04811ceec9b2d18181ac060136eda09d"></a><!-- doxytag: member="sprite::draw_sprite_rotated_scaled" ref="ga04811ceec9b2d18181ac060136eda09d" args="(Sprite *sprt, char *base, int angle, int width, int height)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>draw_sprite_rotated_scaled</b> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base, int angle, int width, int height)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#gaf24b9f5f8dc0c6a60e4263e88ac41a9c">draw_mosaic</a> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga3b37bd781f601a8a1d7eaa34e14c1cd7">delete_sprite</a> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gabe11190455f603b11f3a8a195e9cde45"></a><!-- doxytag: member="sprite::delete_sprite_rotated" ref="gabe11190455f603b11f3a8a195e9cde45" args="(Sprite *sprt, char *base, int angle)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>delete_sprite_rotated</b> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base, int angle)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga0db50460d5c72ad5e6dd2ea26178e968"></a><!-- doxytag: member="sprite::delete_sprite_scaled" ref="ga0db50460d5c72ad5e6dd2ea26178e968" args="(Sprite *sprt, char *base, int width, int height)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>delete_sprite_scaled</b> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base, int width, int height)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga312c0a1681116fec27c3eedc167fde25"></a><!-- doxytag: member="sprite::animate_sprite" ref="ga312c0a1681116fec27c3eedc167fde25" args="(Sprite *sprt, char *base)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>animate_sprite</b> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga255ede37ffcbe9b8130667bcbf007387"></a><!-- doxytag: member="sprite::animate_sprite_rotated" ref="ga255ede37ffcbe9b8130667bcbf007387" args="(Sprite *sprt, char *base, int angle)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>animate_sprite_rotated</b> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, char *base, int angle)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga2fb91a3a8c174bbd441e88256d6db987">move_sprite</a> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt, int x, int y, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga0e7795d3f5963911c80f5167a2f4812b">destroy_sprite</a> (<a class="el" href="struct_sprite.html">Sprite</a> *sprt)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__sprite.html#ga5c0da2e39973a2e7103cc833bb5b827f">move_cursor</a> (<a class="el" href="struct_sprite.html">Sprite</a> *fig, int xstep, int ystep, char *base)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gad61882c39cb6842ec711d1e959e32a7c"></a><!-- doxytag: member="sprite::flip_buffer" ref="gad61882c39cb6842ec711d1e959e32a7c" args="(char *dest, char *src)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>flip_buffer</b> (char *dest, char *src)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga49a1c8dfb402ff70c8861850b67ba0ec"></a><!-- doxytag: member="sprite::flip_buffer_partial" ref="ga49a1c8dfb402ff70c8861850b67ba0ec" args="(char *dest, char *src, int xi, int yi, int width, int height)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><b>flip_buffer_partial</b> (char *dest, char *src, int xi, int yi, int width, int height)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Descrição detalhada</h2>
<p><a class="el" href="struct_sprite.html">Sprite</a> related functions </p>
<hr/><h2>Documentação das macros</h2>
<a class="anchor" id="ga7a047d192cdd3831464a17e3a3e5de6c"></a><!-- doxytag: member="SPRITE.H::LEFT_HIT" ref="ga7a047d192cdd3831464a17e3a3e5de6c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LEFT_HIT&nbsp;&nbsp;&nbsp;3</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>collision with left block (WHITE) </p>

<p>Definido na linha <a class="el" href="#L33">33</a> do ficheiro <a class="el" href="">SPRITE.H</a>.</p>

</div>
</div>
<a class="anchor" id="gac2cd96d53dd3ba6407db6766c3d92b26"></a><!-- doxytag: member="SPRITE.H::MAX_SPEED" ref="gac2cd96d53dd3ba6407db6766c3d92b26" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_SPEED&nbsp;&nbsp;&nbsp;5</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>each sprite maximum speed in pixels/frame </p>

<p>Definido na linha <a class="el" href="#L31">31</a> do ficheiro <a class="el" href="">SPRITE.H</a>.</p>

</div>
</div>
<a class="anchor" id="ga56c64c13c42271b70bcb51986ee8da20"></a><!-- doxytag: member="SPRITE.H::MOUSE_HIT" ref="ga56c64c13c42271b70bcb51986ee8da20" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MOUSE_HIT&nbsp;&nbsp;&nbsp;4</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>collision with mouse (LIGHTMAGENTA) </p>

<p>Definido na linha <a class="el" href="#L34">34</a> do ficheiro <a class="el" href="">SPRITE.H</a>.</p>

</div>
</div>
<a class="anchor" id="gaeb36ab00594b7e7e003a891d8e823f81"></a><!-- doxytag: member="SPRITE.H::RIGHT_HIT" ref="gaeb36ab00594b7e7e003a891d8e823f81" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define RIGHT_HIT&nbsp;&nbsp;&nbsp;2</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>collision with right block (WHITE) </p>

<p>Definido na linha <a class="el" href="#L32">32</a> do ficheiro <a class="el" href="">SPRITE.H</a>.</p>

</div>
</div>
<hr/><h2>Documentação das funções</h2>
<a class="anchor" id="gac732cca247655c1bac63318eb29ffe7f"></a><!-- doxytag: member="SPRITE.H::create_sprite" ref="gac732cca247655c1bac63318eb29ffe7f" args="(char *pic[])" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_sprite.html">Sprite</a>* create_sprite </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>pic</em>[]</td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates with 0 speed and position, a new sprite with pixmap "pic", in memory whose address is "base". Returns NULL on invalid pixmap. </p>

<p>Definido na linha <a class="el" href="#L95">95</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00096"></a>00096 {
<a name="l00097"></a>00097         <a class="code" href="struct_sprite.html">Sprite</a>* sprt = create_unbuffered_sprite(pic);
<a name="l00098"></a>00098         <span class="keywordflow">if</span>(!sprt) <span class="keywordflow">return</span> NULL;
<a name="l00099"></a>00099         sprt-&gt;<a class="code" href="struct_sprite.html#a4cc1a63c6b6bb7981f6b4a054e8fa098" title="the sprite background map">bgmap</a> = malloc(sprt-&gt;width * sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>);
<a name="l00100"></a>00100         <span class="keywordflow">return</span> sprt;
<a name="l00101"></a>00101 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga3b37bd781f601a8a1d7eaa34e14c1cd7"></a><!-- doxytag: member="SPRITE.H::delete_sprite" ref="ga3b37bd781f601a8a1d7eaa34e14c1cd7" args="(Sprite *sprt, char *base)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void delete_sprite </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td>
          <td class="paramname"> <em>sprt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>base</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Removes the sprite from the screen </p>

<p>Definido na linha <a class="el" href="#L326">326</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00327"></a>00327 {
<a name="l00328"></a>00328         <span class="keywordtype">char</span>* bgMap = sprt-&gt;<a class="code" href="struct_sprite.html#a4cc1a63c6b6bb7981f6b4a054e8fa098" title="the sprite background map">bgmap</a>;
<a name="l00329"></a>00329         <span class="keywordflow">if</span>(!bgMap) <span class="keywordflow">return</span>;
<a name="l00330"></a>00330 
<a name="l00331"></a>00331         <span class="keywordtype">int</span> i, k;
<a name="l00332"></a>00332         <span class="keywordflow">for</span>(i=0; i &lt; sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>; i++)
<a name="l00333"></a>00333                 <span class="keywordflow">for</span>(k=0; k &lt; sprt-&gt;width; k++)
<a name="l00334"></a>00334                         <a class="code" href="group__video.html#gac766566a5dad4f67f5b2adaf2020cbdc">set_pixel</a>(sprt-&gt;x+k,sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+i, *(bgMap + sprt-&gt;width*i + k), base);
<a name="l00335"></a>00335                 
<a name="l00336"></a>00336 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga0e7795d3f5963911c80f5167a2f4812b"></a><!-- doxytag: member="SPRITE.H::destroy_sprite" ref="ga0e7795d3f5963911c80f5167a2f4812b" args="(Sprite *sprt)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void destroy_sprite </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td>
          <td class="paramname"> <em>sprt</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The "sprt" sprite is erased from memory whose address is "base" and used resources released. </p>

<p>Definido na linha <a class="el" href="#L376">376</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00377"></a>00377 {
<a name="l00378"></a>00378         <span class="keywordflow">if</span> (!sprt) <span class="keywordflow">return</span>;      
<a name="l00379"></a>00379         free(sprt-&gt;<a class="code" href="struct_sprite.html#a7b00b1bfd666e26484471bd17a74eaa9" title="the sprite pixmap (use read_xpm())">map</a>);
<a name="l00380"></a>00380         free(sprt-&gt;<a class="code" href="struct_sprite.html#a4cc1a63c6b6bb7981f6b4a054e8fa098" title="the sprite background map">bgmap</a>);
<a name="l00381"></a>00381         free(sprt);
<a name="l00382"></a>00382 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="gaf24b9f5f8dc0c6a60e4263e88ac41a9c"></a><!-- doxytag: member="SPRITE.H::draw_mosaic" ref="gaf24b9f5f8dc0c6a60e4263e88ac41a9c" args="(Sprite *sprt, char *base)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void draw_mosaic </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td>
          <td class="paramname"> <em>sprt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>base</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>repeats the sprite 'sprt' all over the background </p>

<p>Definido na linha <a class="el" href="#L298">298</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00299"></a>00299 {
<a name="l00300"></a>00300         <span class="keywordtype">int</span> x_original = sprt-&gt;x;
<a name="l00301"></a>00301         <span class="keywordtype">int</span> y_original = sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>;
<a name="l00302"></a>00302         sprt-&gt;x = sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a> = 0;
<a name="l00303"></a>00303 
<a name="l00304"></a>00304         <span class="keywordtype">int</span> n_sprites_x = <a class="code" href="group__video.html#ga2a60090435aefe2530692883c79d9bb8">HRES</a> / sprt-&gt;width;
<a name="l00305"></a>00305         <span class="keywordtype">int</span> n_sprites_y = <a class="code" href="group__video.html#ga02a30657228763729d9e2351a0b6bcba">VRES</a> / sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>;
<a name="l00306"></a>00306         
<a name="l00307"></a>00307         <span class="keywordtype">int</span> i,k;
<a name="l00308"></a>00308         <span class="keywordflow">for</span>(i = 0; i &lt;= n_sprites_y; i++)
<a name="l00309"></a>00309         {
<a name="l00310"></a>00310                 <span class="keywordflow">for</span>(k = 0; k &lt;= n_sprites_x; k++)
<a name="l00311"></a>00311                 {
<a name="l00312"></a>00312 
<a name="l00313"></a>00313                         <a class="code" href="group__sprite.html#ga5c23ddc01d5d729ab434ae2dbb497d9b">draw_sprite</a>(sprt, base);
<a name="l00314"></a>00314                         sprt-&gt;x += sprt-&gt;width;
<a name="l00315"></a>00315                 }
<a name="l00316"></a>00316                 sprt-&gt;x = 0;
<a name="l00317"></a>00317                 sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a> +=sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>;
<a name="l00318"></a>00318         }
<a name="l00319"></a>00319 
<a name="l00320"></a>00320         sprt-&gt;x = x_original;
<a name="l00321"></a>00321         sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a> = y_original;
<a name="l00322"></a>00322 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga5c23ddc01d5d729ab434ae2dbb497d9b"></a><!-- doxytag: member="SPRITE.H::draw_sprite" ref="ga5c23ddc01d5d729ab434ae2dbb497d9b" args="(Sprite *sprt, char *base)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void draw_sprite </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td>
          <td class="paramname"> <em>sprt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>base</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>draws a sprite in graphics memory the sprite's background color isn't drawn </p>

<p>Definido na linha <a class="el" href="#L147">147</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00148"></a>00148 {
<a name="l00149"></a>00149         <span class="keywordtype">char</span>* dSprt = sprt-&gt;<a class="code" href="struct_sprite.html#a7b00b1bfd666e26484471bd17a74eaa9" title="the sprite pixmap (use read_xpm())">map</a>;
<a name="l00150"></a>00150         <span class="keywordtype">char</span>* bgMap = sprt-&gt;<a class="code" href="struct_sprite.html#a4cc1a63c6b6bb7981f6b4a054e8fa098" title="the sprite background map">bgmap</a>;
<a name="l00151"></a>00151         
<a name="l00152"></a>00152         <span class="keywordtype">int</span> i,k;
<a name="l00153"></a>00153         <span class="keywordflow">for</span>(i=0; i &lt; sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>; i++)
<a name="l00154"></a>00154                 <span class="keywordflow">for</span>(k=0; k &lt; sprt-&gt;width; k++)
<a name="l00155"></a>00155                 {
<a name="l00156"></a>00156                         <span class="keywordflow">if</span>(bgMap) *(bgMap + sprt-&gt;width*i + k) = <a class="code" href="group__video.html#ga04b964260ff0cb0c34668ab91ad7f841">get_pixel</a>(sprt-&gt;x+k, sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+i, base); <span class="comment">//guarda o valor antigo</span>
<a name="l00157"></a>00157                         <span class="keywordflow">if</span>(*dSprt != 0) <a class="code" href="group__video.html#gac766566a5dad4f67f5b2adaf2020cbdc">set_pixel</a>(sprt-&gt;x+k,sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+i, *dSprt, base);  <span class="comment">//actualiza com o valor actual</span>
<a name="l00158"></a>00158                         dSprt++;
<a name="l00159"></a>00159                 }
<a name="l00160"></a>00160 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="gafd72bd42b3d68e35201c12ce287cd3e7"></a><!-- doxytag: member="SPRITE.H::draw_sprite_rotated" ref="gafd72bd42b3d68e35201c12ce287cd3e7" args="(Sprite *sprt, char *base, int angle)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void draw_sprite_rotated </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td>
          <td class="paramname"> <em>sprt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>angle</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>draws a sprite in graphics memory rotating the sprite with a certain angle the sprite's background color isn't drawn </p>

<p>Definido na linha <a class="el" href="#L165">165</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00166"></a>00166 {
<a name="l00167"></a>00167         <span class="keywordtype">char</span>* dSprt = sprt-&gt;<a class="code" href="struct_sprite.html#a7b00b1bfd666e26484471bd17a74eaa9" title="the sprite pixmap (use read_xpm())">map</a>;
<a name="l00168"></a>00168         <span class="keywordtype">char</span>* bgMap = sprt-&gt;<a class="code" href="struct_sprite.html#a4cc1a63c6b6bb7981f6b4a054e8fa098" title="the sprite background map">bgmap</a>;
<a name="l00169"></a>00169         
<a name="l00170"></a>00170         <span class="keywordflow">while</span>(angle &lt; 0) angle += 360;
<a name="l00171"></a>00171         <span class="keywordflow">while</span>(angle &gt;= 360) angle -= 360;
<a name="l00172"></a>00172 
<a name="l00173"></a>00173         <span class="keywordtype">int</span> i, k;
<a name="l00174"></a>00174         <span class="keywordflow">if</span>(bgMap)
<a name="l00175"></a>00175         {
<a name="l00176"></a>00176                 <span class="comment">//guarda uma copia do background onde vai ser desenhada a sprite</span>
<a name="l00177"></a>00177                 <span class="keywordflow">for</span>(i=0; i &lt; sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>; i++)
<a name="l00178"></a>00178                         <span class="keywordflow">for</span>(k=0; k &lt; sprt-&gt;width; k++)
<a name="l00179"></a>00179                                 <span class="keywordflow">if</span> (angle==0 || angle==180 || angle==360) <span class="comment">//caso as dimensoes vertical e horizontal da sprite se mantenham</span>
<a name="l00180"></a>00180                                         *(bgMap + sprt-&gt;width*i + k) = <a class="code" href="group__video.html#ga04b964260ff0cb0c34668ab91ad7f841">get_pixel</a>(sprt-&gt;x+k, sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+i, base);
<a name="l00181"></a>00181                                 <span class="keywordflow">else</span>
<a name="l00182"></a>00182                                         *(bgMap + sprt-&gt;width*k + i) = <a class="code" href="group__video.html#ga04b964260ff0cb0c34668ab91ad7f841">get_pixel</a>(sprt-&gt;x+k, sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+i, base);
<a name="l00183"></a>00183         }
<a name="l00184"></a>00184                         
<a name="l00185"></a>00185         <span class="comment">//desenhar a sprite no sitio certo conforme o angulo            </span>
<a name="l00186"></a>00186         <span class="keywordflow">for</span>(i=0; i &lt; sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>; i++)
<a name="l00187"></a>00187                 <span class="keywordflow">for</span>(k=0; k &lt; sprt-&gt;width; k++)
<a name="l00188"></a>00188                 {
<a name="l00189"></a>00189                         <span class="keywordflow">if</span>(*dSprt != 0)
<a name="l00190"></a>00190                                 <span class="keywordflow">switch</span>(angle)
<a name="l00191"></a>00191                                 {
<a name="l00192"></a>00192                                         <span class="keywordflow">case</span> 90:        
<a name="l00193"></a>00193                                                 <a class="code" href="group__video.html#gac766566a5dad4f67f5b2adaf2020cbdc">set_pixel</a>(sprt-&gt;x+i,sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+k, *dSprt, base);<span class="comment">//actualiza com o valor actual</span>
<a name="l00194"></a>00194                                                 <span class="keywordflow">break</span>;
<a name="l00195"></a>00195                                         <span class="keywordflow">case</span> 180:
<a name="l00196"></a>00196                                                 <a class="code" href="group__video.html#gac766566a5dad4f67f5b2adaf2020cbdc">set_pixel</a>(sprt-&gt;x+sprt-&gt;width-k,sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>-i, *dSprt, base); <span class="comment">//actualiza com o valor actual</span>
<a name="l00197"></a>00197                                                 <span class="keywordflow">break</span>;
<a name="l00198"></a>00198                                         <span class="keywordflow">case</span> 270:
<a name="l00199"></a>00199                                                 <a class="code" href="group__video.html#gac766566a5dad4f67f5b2adaf2020cbdc">set_pixel</a>(sprt-&gt;x+sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>-i,sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+sprt-&gt;width-k, *dSprt, base); <span class="comment">//actualiza com o valor actual</span>
<a name="l00200"></a>00200                                                 <span class="keywordflow">break</span>;
<a name="l00201"></a>00201                                         <span class="keywordflow">default</span>: <span class="comment">//angulo 0 e 360</span>
<a name="l00202"></a>00202                                                 <a class="code" href="group__video.html#gac766566a5dad4f67f5b2adaf2020cbdc">set_pixel</a>(sprt-&gt;x+k,sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>+i, *dSprt, base);  <span class="comment">//actualiza com o valor actual</span>
<a name="l00203"></a>00203                                                 <span class="keywordflow">break</span>;
<a name="l00204"></a>00204                                 }
<a name="l00205"></a>00205                                         
<a name="l00206"></a>00206                         dSprt++;
<a name="l00207"></a>00207                 }
<a name="l00208"></a>00208 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga5c0da2e39973a2e7103cc833bb5b827f"></a><!-- doxytag: member="SPRITE.H::move_cursor" ref="ga5c0da2e39973a2e7103cc833bb5b827f" args="(Sprite *fig, int xstep, int ystep, char *base)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void move_cursor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td>
          <td class="paramname"> <em>fig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>xstep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>ystep</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>base</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Move in memory whose address is 'base', the 'sprt' cursor, a standard sprite, from its current position to a new position 'xstep' and 'ystep' away. The cursor is erased from its present position in xor-mode and draw in the new position also oin xor-mode. The first time this function is called it only draws the cursor at the current position. </p>

</div>
</div>
<a class="anchor" id="ga2fb91a3a8c174bbd441e88256d6db987"></a><!-- doxytag: member="SPRITE.H::move_sprite" ref="ga2fb91a3a8c174bbd441e88256d6db987" args="(Sprite *sprt, int x, int y, char *base)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void move_sprite </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sprite.html">Sprite</a> *&nbsp;</td>
          <td class="paramname"> <em>sprt</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>base</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>moves the sprite 'sprt' to the position (x,y) </p>

<p>Definido na linha <a class="el" href="#L405">405</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00406"></a>00406 {
<a name="l00407"></a>00407         <span class="keywordtype">int</span> xi = (x &gt; sprt-&gt;x) ? sprt-&gt;x : x;
<a name="l00408"></a>00408         <span class="keywordtype">int</span> yi = (y &gt; sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>) ? sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a> : y;
<a name="l00409"></a>00409         <span class="keywordtype">int</span> xf = (x &gt; sprt-&gt;x) ? x + sprt-&gt;width : sprt-&gt;x + sprt-&gt;width;
<a name="l00410"></a>00410         <span class="keywordtype">int</span> yf = (y &gt; sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a>) ? y + sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a> : sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a> + sprt-&gt;<a class="code" href="struct_sprite.html#ad12fc34ce789bce6c8a05d8a17138534" title="sprite dimensions">height</a>;
<a name="l00411"></a>00411         
<a name="l00412"></a>00412         video_buffer = realloc(video_buffer, <a class="code" href="group__video.html#ga2a60090435aefe2530692883c79d9bb8">HRES</a> * <a class="code" href="group__video.html#ga02a30657228763729d9e2351a0b6bcba">VRES</a>);
<a name="l00413"></a>00413         flip_buffer_partial(video_buffer, base, xi, yi, xf - xi, yf - yi);
<a name="l00414"></a>00414         
<a name="l00415"></a>00415         <a class="code" href="group__sprite.html#ga3b37bd781f601a8a1d7eaa34e14c1cd7">delete_sprite</a>(sprt, video_buffer);
<a name="l00416"></a>00416         sprt-&gt;x = x;
<a name="l00417"></a>00417         sprt-&gt;<a class="code" href="struct_sprite.html#a0a2f84ed7838f07779ae24c5a9086d33" title="current sprite position">y</a> = y;
<a name="l00418"></a>00418         <a class="code" href="group__sprite.html#ga5c23ddc01d5d729ab434ae2dbb497d9b">draw_sprite</a>(sprt, video_buffer);
<a name="l00419"></a>00419         
<a name="l00420"></a>00420         flip_buffer_partial(base, video_buffer, xi, yi, xf - xi, yf - yi);
<a name="l00421"></a>00421 }
</pre></div></p>

</div>
</div>
<a class="anchor" id="ga87bd140b1b1b28386f37ebac5c9b9d2e"></a><!-- doxytag: member="SPRITE.H::read_xpm" ref="ga87bd140b1b1b28386f37ebac5c9b9d2e" args="(char *map[], int *width, int *height)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* read_xpm </td>
          <td>(</td>
          <td class="paramtype">char *&nbsp;</td>
          <td class="paramname"> <em>map</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>wd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>ht</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Reads a xpm-like sprite defined in "map" (look at <a class="el" href="">pixmap.h</a> for examples). Returns the address of the allocated memory where the sprite was read. Updates "width" and "heigh" with the sprite dimension. Return NULL on error. Assumes that VRES and HRES (the screen vertical and horizontal resolution) are externaly defined.</p>
<p>Usage example, using the defined sprite in <a class="el" href="">pixmap.h</a>: </p>
<pre>
   include "pixmap.h" // defines  pic1, pic2, etc 
   int wd, hg;
   char *sprite = read_xpm(pic1, &amp;wd, &amp;hg);
 </pre> 
<p>Definido na linha <a class="el" href="#L22">22</a> do ficheiro <a class="el" href="">SPRITE.C</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00023"></a>00023 {
<a name="l00024"></a>00024         <a class="code" href="struct____attribute____.html">__attribute__</a>((unused)) static <span class="keywordtype">char</span> read_xpm_jcard;
<a name="l00025"></a>00025 
<a name="l00026"></a>00026         <span class="keywordtype">int</span> width, height, colors;
<a name="l00027"></a>00027         <span class="keywordtype">char</span> sym[256];
<a name="l00028"></a>00028         <span class="keywordtype">int</span>  col;
<a name="l00029"></a>00029         <span class="keywordtype">int</span> i, j;
<a name="l00030"></a>00030         <span class="keywordtype">char</span> *pix, *pixtmp, *tmp, *line;
<a name="l00031"></a>00031         <span class="keywordtype">char</span> symbol;
<a name="l00032"></a>00032 
<a name="l00033"></a>00033         <span class="comment">// read width, height, colors</span>
<a name="l00034"></a>00034         if (sscanf(map[0],&quot;%d %d %d&quot;, &amp;width, &amp;height, &amp;colors) != 3) {
<a name="l00035"></a>00035                 printf(<span class="stringliteral">&quot;read_xpm: incorrect width, height, colors\n&quot;</span>);
<a name="l00036"></a>00036                 <span class="keywordflow">return</span> NULL;
<a name="l00037"></a>00037         }
<a name="l00038"></a>00038 <span class="preprocessor">        #ifdef DEBUG</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span>        printf(<span class="stringliteral">&quot;%d %d %d\n&quot;</span>, width, height, colors);
<a name="l00040"></a>00040 <span class="preprocessor">        #endif</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span>        <span class="keywordflow">if</span> (width &gt; <a class="code" href="group__video.html#ga2a60090435aefe2530692883c79d9bb8">HRES</a> || height &gt; <a class="code" href="group__video.html#ga02a30657228763729d9e2351a0b6bcba">VRES</a> || colors &gt; 256) {
<a name="l00042"></a>00042                 printf(<span class="stringliteral">&quot;read_xpm: incorrect width, height, colors\n&quot;</span>);
<a name="l00043"></a>00043                 <span class="keywordflow">return</span> NULL;
<a name="l00044"></a>00044         }
<a name="l00045"></a>00045 
<a name="l00046"></a>00046         *wd = width;
<a name="l00047"></a>00047         *ht = height;
<a name="l00048"></a>00048 
<a name="l00049"></a>00049         <span class="keywordflow">for</span> (i=0; i&lt;256; i++)
<a name="l00050"></a>00050         sym[i] = 0;
<a name="l00051"></a>00051 
<a name="l00052"></a>00052         <span class="comment">// read symbols &lt;-&gt; colors </span>
<a name="l00053"></a>00053         <span class="keywordflow">for</span> (i=0; i&lt;colors; i++) {
<a name="l00054"></a>00054                 <span class="keywordflow">if</span> (sscanf(map[i+1], <span class="stringliteral">&quot;%c %d&quot;</span>, &amp;symbol, &amp;col) != 2) {
<a name="l00055"></a>00055                         printf(<span class="stringliteral">&quot;read_xpm: incorrect symbol, color at line %d\n&quot;</span>, i+1);
<a name="l00056"></a>00056                         <span class="keywordflow">return</span> NULL;
<a name="l00057"></a>00057                 }
<a name="l00058"></a>00058 <span class="preprocessor">        #ifdef DEBUG</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>                printf(<span class="stringliteral">&quot;%c %d\n&quot;</span>, symbol, col);
<a name="l00060"></a>00060 <span class="preprocessor">        #endif</span>
<a name="l00061"></a>00061 <span class="preprocessor"></span>                <span class="keywordflow">if</span> (col &gt; 256) {
<a name="l00062"></a>00062                         printf(<span class="stringliteral">&quot;read_xpm: incorrect color at line %d\n&quot;</span>, i+1);
<a name="l00063"></a>00063                         <span class="keywordflow">return</span> NULL;
<a name="l00064"></a>00064                 }
<a name="l00065"></a>00065                 sym[col] = symbol;
<a name="l00066"></a>00066         }
<a name="l00067"></a>00067 
<a name="l00068"></a>00068         <span class="comment">// allocate pixmap memory</span>
<a name="l00069"></a>00069         pix = pixtmp = malloc(width*height);
<a name="l00070"></a>00070 
<a name="l00071"></a>00071         <span class="comment">// parse each pixmap symbol line</span>
<a name="l00072"></a>00072         <span class="keywordflow">for</span> (i=0; i&lt;height; i++) {
<a name="l00073"></a>00073                 line = map[colors+1+i];
<a name="l00074"></a>00074 <span class="preprocessor">        #ifdef DEBUG</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span>                printf(<span class="stringliteral">&quot;\nparsing %s\n&quot;</span>, line);
<a name="l00076"></a>00076 <span class="preprocessor">        #endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>                <span class="keywordflow">for</span> (j=0; j&lt;width; j++) {
<a name="l00078"></a>00078                         tmp = memchr(sym, line[j], 256);  <span class="comment">// find color of each symbol</span>
<a name="l00079"></a>00079                         <span class="keywordflow">if</span> (tmp == NULL) {
<a name="l00080"></a>00080                                 printf(<span class="stringliteral">&quot;read_xpm: incorrect symbol at line %d, col %d\n&quot;</span>, colors+i+1, j);
<a name="l00081"></a>00081                                 <span class="keywordflow">return</span> NULL;
<a name="l00082"></a>00082                         }
<a name="l00083"></a>00083                         *pixtmp++ = tmp - sym; <span class="comment">// pointer arithmetic! back to books :-)</span>
<a name="l00084"></a>00084 <span class="preprocessor">        #ifdef DEBUG</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span>                        printf(<span class="stringliteral">&quot;%c:%d &quot;</span>, line[j], tmp-sym);
<a name="l00086"></a>00086 <span class="preprocessor">        #endif</span>
<a name="l00087"></a>00087 <span class="preprocessor"></span>                }
<a name="l00088"></a>00088         }
<a name="l00089"></a>00089 
<a name="l00090"></a>00090         <span class="keywordflow">return</span> pix;
<a name="l00091"></a>00091 }
</pre></div></p>

</div>
</div>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Gerado em Tue Jun 1 22:04:49 2010 para FEUP-Defender por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
